<template>
	<view>
		<view class="goods-list">
			<view class="goods-item" @click="goshop(item.id)" v-for="(item,index) in shopList" :key="index">
				<image :src="item.imgUrl" mode="aspectFit"></image>
				<view class="price">
					<text>￥{{item.sellPrice}}</text>
					<text>￥{{item.marketPrice}}</text>
				</view>
				<view class="name">
					<text>{{item.title}}</text>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		props:["shopList"],
		data() {
			return {
				
			}
		},
		methods: {
			goshop(id){
				this.$emit("goshop",id)
			}
		}
	}
</script>

<style lang="scss">
	//推荐商品样式
	.goods-list{
		display: flex;
		flex-wrap: wrap;
		justify-content: space-between;
		padding: 0 15rpx;
		.goods-item{
			background-color: #fff;
			width: 355rpx;
			margin:10rpx 0;
			text-align: center;
			padding: 15px;
			box-sizing: border-box;
			image{
				width: 100%;
				height: 150px;
			}
			.price{
				color:red;
				text-align: left;
				font-size: 1rem;
				text:nth-child(1){
					font-size: 1.2rem;
				}
				text:nth-child(2){
					color: #afafaf;
					margin-left: 10rpx;
					text-decoration: line-through;
				}
			}
			.name{
				text-align:left;
				font-size:1rem;
				line-height:25px;
				padding-top:10px;
				padding-bottom:10px;
			}
		}
	}

</style>
